From e5249d12dd0874c081e69ed7b617ea74de9c6efc Mon Sep 17 00:00:00 2001 From: "robertlipe@gmail.com" Date: Sat, 12 Nov 2011 22:18:12 +0000 Subject: [PATCH] Fix minor mem leaks in garmin_gpi, bushnell, bushnell_trl, delgpl git-svn-id: http://gpsbabel.googlecode.com/svn/trunk@4104 f51c46e8-681c-474f-0cfe-069cfd0219fb --- gpsbabel/bushnell.c | 1 + gpsbabel/bushnell_trl.c | 2 +- gpsbabel/delgpl.c | 1 + gpsbabel/garmin_gpi.c | 2 +- 4 files changed, 4 insertions(+), 2 deletions(-) diff --git a/gpsbabel/bushnell.c b/gpsbabel/bushnell.c index aafe1478c..029cbca59 100644 --- a/gpsbabel/bushnell.c +++ b/gpsbabel/bushnell.c @@ -245,6 +245,7 @@ bushnell_write_one(const waypoint* wpt) gbfwrite(padding, sizeof(padding), 1, file_out); xfree(fname); + xfree(ident); gbfclose(file_out); } diff --git a/gpsbabel/bushnell_trl.c b/gpsbabel/bushnell_trl.c index 941c2f445..7d1f17332 100644 --- a/gpsbabel/bushnell_trl.c +++ b/gpsbabel/bushnell_trl.c @@ -49,7 +49,7 @@ rd_init(const char* fname) static void rd_deinit(void) { - gbfclose(file_out); + gbfclose(file_in); } static void diff --git a/gpsbabel/delgpl.c b/gpsbabel/delgpl.c index 881616caa..29006c7ff 100644 --- a/gpsbabel/delgpl.c +++ b/gpsbabel/delgpl.c @@ -95,6 +95,7 @@ gpl_read(void) // in time. The only thing I see "special" about those // trackpoints is that these fields are zeroed. Toss them. if ((wpt_tmp->speed == 0.0) && (wpt_tmp->course == 0.0)) { + waypt_free(wpt_tmp); continue; } track_add_wpt(track_head, wpt_tmp); diff --git a/gpsbabel/garmin_gpi.c b/gpsbabel/garmin_gpi.c index 9f2930079..89ccee49b 100644 --- a/gpsbabel/garmin_gpi.c +++ b/gpsbabel/garmin_gpi.c @@ -642,7 +642,7 @@ read_tag(const char* caller, const int tag, waypoint* wpt) GMSD_SET(email, str); } if ((mask & 0x10) && (str = gpi_read_string("Link"))) { - waypt_add_url(wpt, xstrdup(str), xstrdup(str)); + waypt_add_url(wpt, xstrdup(str), str); } break; -- 2.30.2